package com.glsc.ngateway.common.base.converter.platform;

import com.alibaba.excel.util.CollectionUtils;
import com.glsc.ngateway.common.base.domain.mysql.gateway.platform.it.networkassets.NetworkAssetMaintenance;
import com.glsc.ngateway.common.base.domainmapper.NetworkAssetMaintenanceMapper;
import com.glsc.ngateway.common.api.platform.dto.it.networkassets.NetworkAssetMaintenanceDto;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @author xuchang
 */
public class NetworkAssetMaintenanceConverter {
    public static NetworkAssetMaintenanceDto do2Dto(NetworkAssetMaintenance domain){
        return NetworkAssetMaintenanceMapper.INSTANCE.domain2dto(domain);
    }

    public static List<NetworkAssetMaintenanceDto> do2Dto(List<NetworkAssetMaintenance> doList){
        return CollectionUtils.isEmpty(doList) ? java.util.Collections.EMPTY_LIST : doList.stream().map(NetworkAssetMaintenanceConverter::do2Dto).collect(Collectors.toList());
    }

    public static NetworkAssetMaintenance dto2Do(NetworkAssetMaintenanceDto dto){
        return NetworkAssetMaintenanceMapper.INSTANCE.dto2domain(dto);
    }

    public static List<NetworkAssetMaintenance> dto2Do(List<NetworkAssetMaintenanceDto> dtoList){
        return CollectionUtils.isEmpty(dtoList) ? java.util.Collections.EMPTY_LIST : dtoList.stream().map(NetworkAssetMaintenanceConverter::dto2Do).collect(Collectors.toList());
    }
}
